Repository navigation
refactor: overhaul review queue and PR fixer with structured output - #65
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (9)
Cache: Disabled due to data retention organization setting Knowledge base: Disabled due to data retention organization setting WalkthroughThis PR refactors internal PR workflow scripts and documentation across two pipelines (pr-fixer and pr-overview). Changes introduce dedicated Python data-structuring scripts to consolidate artifact organization, remove deprecated utilities, simplify shell script argument handling, and replace verbose multi-phase guidance with modular, action-first workflows. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant FetchScript as fetch-pr.sh / fetch-prs.sh
participant TMPDIR
participant StructureScript as structure-pr-data.py
participant OutputDir as artifacts/{number}/
participant AnalyzeScript as analyze-prs.py
User->>FetchScript: Invoke with --repo, --pr/--output-dir
FetchScript->>TMPDIR: Create temp directory
FetchScript->>TMPDIR: Fetch pr.json, reviews.json, review_comments.json in parallel
FetchScript->>TMPDIR: Optionally fetch check_runs.json and CI logs
FetchScript->>StructureScript: Pass TMPDIR artifacts
StructureScript->>OutputDir: Generate summary.json, comments/, ci/, diff.json, reviews/
FetchScript->>User: Return output directory path
Note over AnalyzeScript: (PR Overview only)
User->>AnalyzeScript: Invoke with --output-dir
AnalyzeScript->>OutputDir: Read per-PR summary.json files
AnalyzeScript->>OutputDir: Write per-PR analysis.json
AnalyzeScript->>OutputDir: Generate queue.json with rankings
AnalyzeScript->>User: Return review order and stats
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
New per-PR output structure: summary.json — one-read overview (metadata, CI, comments, reviews) comments/ — overview.json + chronological numbered files with IDs ci/ — overview.json + logs/ (opt-in via --with-logs, truncated 200 lines) diff.json — single file with overview + patches reviews/ — overview.json with approval state analysis.json — written separately by analyze-prs.py Scripts: - structure-pr-data.py: takes raw API JSON, produces clean directory (duplicated in each workflow since they run in isolation) - fetch-pr.sh: parallel API calls, --with-logs for CI failure output - fetch-prs.sh: loops all PRs, uses local structure-pr-data.py - analyze-prs.py: reads summary.json, writes analysis.json + queue.json CLAUDE.md files simplified: goal, scripts, judgment calls, constraints. Deleted: merge-comments.py, test-merge-order.sh Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
f426d2e to
5e533d2
Compare
Summary
Follow-up to #63. Overhauls both workflows based on real-world usage feedback.
Structured output per PR
Each PR now gets a clean directory layout that the agent reads hierarchically:
summary.json— one read tells the agent what's wrong and where to dig deepercomments/— overview + chronological numbered files (with IDs for replying)ci/— overview + failure logs (opt-in, truncated to 200 lines)diff.json— single file with overview + patchesreviews/— approval state overviewanalysis.json— written separately by analyze script (never modifies summary)Simplified CLAUDE.md files (71% reduction)
PR Fixer improvements
Script changes
structure-pr-data.py— new shared data processor (duplicated in each workflow)fetch-pr.sh— parallel API calls,--with-logsfor CI failure outputfetch-prs.sh— loops all PRs, uses same data processoranalyze-prs.py— reads new structure, writesanalysis.json+queue.jsonmerge-comments.py,test-merge-order.shTest plan
fetch-pr.shagainst a single PR, verify directory layoutfetch-prs.shagainst repo with open PRsanalyze-prs.pyon fetched data, verify queue.json--with-logsfetches truncated CI failure logs@ambient-fixand verify it reads structured data🤖 Generated with Claude Code